extensions: HSV.o: return the number of samples processed, not always 0
authorMichael Natterer <mitch@gimp.org>
Sun, 7 Apr 2013 14:04:49 +0000 (16:04 +0200)
committerMichael Natterer <mitch@gimp.org>
Sun, 7 Apr 2013 14:04:49 +0000 (16:04 +0200)
extensions/HSV.c

index 6185fb73940fc236682aaedfe724665177989342..6c66f42b9aad63474cceb96257c572da09a51b24 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+
 #include <math.h>
 #include <string.h>
 
 
 static long  rgba_to_hsva (char *src,
                            char *dst,
-                           long  n);
+                           long  samples);
 
 static long  hsva_to_rgba (char *src,
                            char *dst,
-                           long  n);
+                           long  samples);
 
 int init (void);
 
@@ -87,8 +88,10 @@ init (void)
 static long
 rgba_to_hsva (char *src,
               char *dst,
-              long  n)
+              long  samples)
 {
+  long n = samples;
+
   while (n--)
   {
     double red   = ((double *) src)[0];
@@ -148,14 +151,17 @@ rgba_to_hsva (char *src,
     src += 4 * sizeof (double);
     dst += 4 * sizeof (double);
   }
-  return n;
+
+  return samples;
 }
 
 static long
 hsva_to_rgba (char *src,
               char *dst,
-              long  n)
+              long  samples)
 {
+  long n = samples;
+
   while (n--)
   {
     double hue        = ((double *) src)[0];
@@ -216,5 +222,6 @@ hsva_to_rgba (char *src,
     src += 4 * sizeof (double);
     dst += 4 * sizeof (double);
   }
-  return n;
+
+  return samples;
 }